package com.spring.xiatian.uitl;

import com.spring.xiatian.enums.ResultEnum;
import org.omg.CORBA.Object;

/**
 * Created by Created by xiaoxia on 2017/10/05 0001 0:26.
 */
public class ResultUtil {

    public static Result success(Object data){
        Result result = new Result();
        result.setCode(ResultEnum.UserEnums.SUCCESS.getCode());
        result.setMsg(ResultEnum.UserEnums.SUCCESS.getMsg());
        result.setData(data);
        return result;
    }

    public static Result fail(int code,String msg){
        return new Result(code,msg);
    }

}
